package com.ruoyi.web.controller.aggregation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.aggregation.Account;
import com.ruoyi.system.service.aggregation.IAccountService;

/**
 * 账户Controller
 * 
 * @author ruoyi
 * @date 2025-01-01
 */
@RestController
@RequestMapping("/agg/account")
public class AccountController
{
    @Autowired
    private IAccountService accountService;

    /**
     * 查询账户详情
     */
    @GetMapping("/getInfo")
    public AjaxResult getInfo(@RequestParam Long userId)
    {
        try
        {
            Account account = accountService.selectAccountByUserId(userId);
            return AjaxResult.success(account);
        }
        catch (Exception e)
        {
            return AjaxResult.error(e.getMessage());
        }
    }
}

